<?php 

class Event_CommentPostSelect extends Crud_Event_Handler 
{
	protected $_type = 'postSelect';
	
	/**
	 * Run handler with options array.
	 * 
	 * @param Db_Select $row
	 * @return void
	 */
	public function run($select)
	{
		$select->reset('columns');
		
		$select->columns(array('profile_id'=>' if(`profile_id` is null,`unreg_user_email`,`profile_id`)','item_id','i_id'=>'item_id','id','created_at','text','admin_answer'));
		$select->setIntegrityCheck(false);
		$select->join('product','comment.item_id=product.id',array('product_name'=>'name'));
	  //die($select);
		
		
	}
}

